package com.pacai.Method;

public class Person {
    String name;
    int age;

    public void speak(){
        System.out.println("演讲");
    }

    public int cal01(){
        int sum = 0;
        for (int i = 1; i <= 1000; i++) {
            sum += i;
        }
        return sum;
    }

    public int cal02(int n){
        int sum = 0;
        for (int i = 1; i <= n; i++) {
            sum += i;
        }
        return sum;
    }


    public int getSum(int factor,int factor2){
        return factor + factor2;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
